package com.rongshu.view.userInfo.dialog;

import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.rongshu.R;
import com.utils.DensityUtil;

public class ChiefExperienceOfficerDialog extends Dialog {

    public ChiefExperienceOfficerDialog(@NonNull Context context) {
        super(context);
    }

    public ChiefExperienceOfficerDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    protected ChiefExperienceOfficerDialog(@NonNull Context context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    public static class Builder {
        private Context context; // 上下文对象
        private int mMainLayout = R.layout.dialog_chief_experience_officer_view;
        private TextView txt_cancle;

        public Builder(Context context) {
            this.context = context;
        }

        public ChiefExperienceOfficerDialog create() {
            LayoutInflater inflater = (LayoutInflater) context
                    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            final ChiefExperienceOfficerDialog dialog = new ChiefExperienceOfficerDialog(context, R.style.CustomDialog);
            View layout = inflater.inflate(mMainLayout, null);
            txt_cancle = layout.findViewById(R.id.txt_cancle);
            txt_cancle.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    dialog.dismiss();
                }
            });
            dialog.addContentView(layout, new ViewGroup.LayoutParams(
                    ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
            return dialog;
        }
    }

    @Override
    public void show() {
        super.show();
    }
}
